package com.open.gen.util;

import java.io.InputStreamReader;
import java.util.Properties;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class PropUtils {

    private static Logger log = LoggerFactory.getLogger(PropUtils.class);

    public static final Properties CONFIG = new Properties();

    static {
        try {
            CONFIG.load(new InputStreamReader(PropUtils.class.getClassLoader().getResourceAsStream("db.properties"), "UTF-8"));
        } catch (Exception e) {
            log.error("解析Properties配置文件发生异常，异常详情：", e);
        } finally {
            CONFIG.clone();
        }
    }

    public static String getProperties(String key) {
        return CONFIG.getProperty(key);
    }

}
